package fileAndIO;

import org.junit.Test;

import java.io.*;

// 转换流
public class Test5 {
    @Test
    public void test1() throws IOException {
        InputStreamReader inputStreamReader1 = new InputStreamReader(new FileInputStream("C:\\Users\\83726\\ccc\\aa.txt"));
        InputStreamReader inputStreamReader2 = new InputStreamReader(new FileInputStream("C:\\Users\\83726\\ccc\\aa.txt"), "GBK");
        int read;
        while ((read = inputStreamReader1.read()) != -1) {
            System.out.print((char) read);
        }
        inputStreamReader1.close();

        System.out.println("================");
        while ((read = inputStreamReader2.read()) != -1) {
            System.out.print((char) read);
        }
    }
}
